var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function r() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (r.prototype = e.prototype, 
    new r());
}), a = this && this.__decorate || function(t, e, o, r) {
    var n, i = arguments.length, c = i < 3 ? e : null === r ? r = Object.getOwnPropertyDescriptor(e, o) : r;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, o, r); else for (var a = t.length - 1; 0 <= a; a--) (n = t[a]) && (c = (i < 3 ? n(c) : 3 < i ? n(e, o, c) : n(e, o)) || c);
    return 3 < i && c && Object.defineProperty(e, o, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameRankItem"), s = cc._decorator, c = s.ccclass, l = s.property, d = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.item = null, t.layout = null, t.bg = null, t.items = [], t;
    }
    return i(t, e), t.prototype.start = function() {}, t.prototype.init = function(t) {
        var n = this;
        cc.log("rank init"), this.items = [], this.items.push(this.item), t.forEach(function(t, e) {
            var o;
            0 < e ? ((e = (o = cc.instantiate(n.item.node)).getComponent(r.default)).init(t), 
            o.parent = n.layout, n.items.push(e)) : n.item.init(t);
        }), this.bg.setContentSize(260, 39 * t.length + 25), this.item.rankLabel.node.color = cc.Color.ORANGE, 
        this.item.headView.label.node.color = cc.Color.ORANGE, this.items.forEach(function(t, e) {
            t.rankLabel.node.active = !0, t.rankLabel.string = (e + 1).toString();
        });
    }, t.prototype.showRestart = function() {}, t.prototype.refresh = function(e, o) {
        var r = this;
        this.items.forEach(function(t) {
            if (t.player == e) switch (o) {
              case 0:
                t.showSprite("image/ui/淘汰@2x");
                break;

              case 1:
                r.showRestart(e), t.showSprite("image/ui/复活了@2x", 2);
            }
        });
    }, a([ l(r.default) ], t.prototype, "item", void 0), a([ l(cc.Node) ], t.prototype, "layout", void 0), 
    a([ l(cc.Node) ], t.prototype, "bg", void 0), a([ c ], t);
}(cc.Component);

n.default = d;